#include <REGX52.H>
#include "delay.h"

void SG(int count,int num)
{
	unsigned char tab2[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};
	switch (count)
  {
  	case 1:P2=0x01; break;
  	case 2:P2=0x02; break;
		case 3:P2=0x04; break;
		case 4:P2=0x08; break;
  }
	P0=0xff-tab2[num];
	P2=0;
	Delay(15);
}

//void SG(int count0,int count,int num)
//{
//	unsigned char tab2[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};
//	unsigned char count[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
//	
//}